package mirrormonkey.util.netevent.server.tools;

import java.util.Collection;

import com.jme3.network.ConnectionListener;
import com.jme3.network.Filter;
import com.jme3.network.HostedConnection;
import com.jme3.network.Message;
import com.jme3.network.MessageListener;
import com.jme3.network.Server;

/**
 * Does nothing but can be used for testing where it is not advisable to pass
 * <tt>null</tt> references.
 * 
 * @author Philipp Christian Loewner
 * 
 */
public class MockServer implements Server {

	@Override
	public String getGameName() {
		return null;
	}

	@Override
	public int getVersion() {
		return 0;
	}

	@Override
	public void broadcast(Message message) {
	}

	@Override
	public void broadcast(Filter<? super HostedConnection> filter,
			Message message) {
	}

	@Override
	public void start() {
	}

	@Override
	public boolean isRunning() {
		return false;
	}

	@Override
	public void close() {
	}

	@Override
	public HostedConnection getConnection(int id) {
		return null;
	}

	@Override
	public Collection<HostedConnection> getConnections() {
		return null;
	}

	@Override
	public void addConnectionListener(ConnectionListener listener) {
	}

	@Override
	public void removeConnectionListener(ConnectionListener listener) {
	}

	@Override
	public void addMessageListener(
			MessageListener<? super HostedConnection> listener) {
	}

	@Override
	@SuppressWarnings("rawtypes")
	public void addMessageListener(
			MessageListener<? super HostedConnection> listener,
			Class... classes) {
	}

	@Override
	public void removeMessageListener(
			MessageListener<? super HostedConnection> listener) {
	}

	@Override
	@SuppressWarnings("rawtypes")
	public void removeMessageListener(
			MessageListener<? super HostedConnection> listener,
			Class... classes) {
	}

	@Override
	public int addChannel(int arg0) {
		return 0;
	}

	@Override
	public void broadcast(int arg0, Filter<? super HostedConnection> arg1,
			Message arg2) {
	}

	@Override
	public boolean hasConnections() {
		return true;
	}

}